import { createRouter, createWebHashHistory } from 'vue-router'
import Login from '@pc/views/login/IndexView.vue'
import HomeView from '@pc/views/home/IndexView.vue'

const gloabRoutes = [
    { path: '/login', name: 'login', component: Login }
]

const routes = [
    ...gloabRoutes,
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        name: 'Home',
        component: HomeView,
    }
]


const router = createRouter({
    history: createWebHashHistory(),
    routes
})


router.beforeEach((_to, _from, next) => {
    next()
})

export default router
